package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class LikePredicatePart2 implements WhenOperand {

    private int beginIndex;
    private int endIndex;
    private boolean not;
    private StringValueExpression pattern;
    private StringValueExpression escape;

    public LikePredicatePart2(int beginIndex,
                              boolean not,
                              StringValueExpression pattern,
                              StringValueExpression escape) {
        this.beginIndex = beginIndex;
        this.endIndex = escape != null ? escape.getEndIndex() : pattern.getEndIndex();
        this.not = not;
        this.pattern = pattern;
        this.escape = escape;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public boolean isNot() {
        return not;
    }

    public StringValueExpression getPattern() {
        return pattern;
    }

    public StringValueExpression getEscape() {
        return escape;
    }

}
